import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner input = new Scanner(System.in);
        NegativeException a = new NegativeException();
        ZeroException b = new ZeroException();
        float c, d;
        System.out.println("Please input first number: ");
        c = input.nextInt();
        System.out.println("Please input second number: ");
        d = input.nextInt();
        try {
            a.error(d);
            b.error(d);
        } catch (NegativeException e) {
            e.b = d;
            e.s();
        } catch (ZeroException e) {

            e.s();
        }

        if (d > 0) {
            System.out.println("Divisor is : " + c / d);
        }

        System.out.println("finally!");


    }
}

class NegativeException extends Exception {
    float b;

    public void error(float a) throws NegativeException {
        if (a < 0) {
            throw new NegativeException();
        }
    }

    public void s() {
        System.out.printf("The divisor, %d, could not be negative!\n", (int) b);
    }
}

class ZeroException extends Exception {
    float a;

    public void error(float a) throws ZeroException {
        if (a == 0) {
            throw new ZeroException();
        }
    }

    public void s() {
        System.out.println("The divisor, 0,could not be zero!\n");
    }
}
